package com.apes.scm.voucher.model;

import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.Model;
import com.apes.framework.jpa.comment.Comment;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;

@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = VoucherLogger.CONST_TABLE_NAME)
public class VoucherLogger  extends Model {
    public static final String CONST_TABLE_NAME = "acc_voucher_logger";

    @Id
    @Column(name = "id", length = 32)
    @Comment("凭证单号")
    private String id;

    @Lob
    @Basic(fetch = FetchType.LAZY)
    @Column(name = "auditing", columnDefinition = "CLOB")
    @Comment("审计内容")
    private String audit;
}
